package com.flx.noodle.websocket.dao;

import com.flx.noodle.websocket.entity.ChatMessage;
import com.flx.noodle.websocket.searcher.MessageSearcher;

import java.util.List;

/**
 * Created by fenglixiong on 2017/10/2.
 */
public interface MessageDao {

    ChatMessage getMessageById(int msgId);

    int insertMessage(ChatMessage chatMessage);

    int updateMessage(ChatMessage chatMessage);

    int deleteMessage(int msgId);

    List<ChatMessage> findMessageList(MessageSearcher searcher);

    /**
     * 找到这个房间此用户的最新一条系统消息
     * @param chatId
     * @param userId
     * @return
     */
    ChatMessage getSystemMsg(int chatId,int userId);

}
